class Student:
    def __init__(self,student_id,name,score):
        self.student_id=student_id
        self.name=name
        self.score=score
def  read_students_form_file(file_path):
     students=[]
     with open(file_path,"r",encoding="utf-8") as file:
         for line in file.readlines():
             student_id,name,score=line.strip().split(',')
             students.append(Student(student_id,name,score))
     return students
if __name__=="__main__":
    file_path="student_txt"
    students=read_students_form_file(file_path)
    students.sort(key=lambda x:x.score,reverse=True)
    for student in students:
        print(f"学号：{student.student_id} 姓名：{student.name}  分数：{student.score}")


